home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QRZ! Ham Radio 8
/
QRZ Ham Radio Callsign Database - Volume 8.iso
/
pc
/
files
/
dsp
/
fteyaltr.z
/
fteyaltr
/
isqrt.c
< prev
next >
Wrap
Text File
|
1991-06-10
|
340b
|
28 lines
int
isqrt (n)
long n;
{
register long i, j;
if (n <= 0)
return (0);
if (n > 0xffffff)
i = n >> 16;
else if (n > 0xffff)
i = n >> 12;
else if (n > 0xff)
i = n >> 8;
else
i = n >> 4;
if (i <= 0)
i = 1;
do {
j = i;
i = (j + n / j) / 2;
} while ((i-j) >= 2 || (j-i) >= 2);
return (i);
}